﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using PowersourceUIToolkit;

namespace ToolkitTestApp
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainViewHost : Window
    {
        public MainViewHost()
        {
            InitializeComponent();
            var tta = (ToolkitTestApp.App)ToolkitTestApp.App.Current;

            tta.UIManager = IoC.Get<IUIManager>();
            tta.AppMainViewModel = ViewModelLocator.GetViewModel<MainViewModel>();
            var ct =tta.UIManager.GetOrCreateControl(tta.AppMainViewModel);

            ct.Visibility = Visibility.Visible;
            ControlBorder.Child = ct;
        }

        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);
            App.Current.Shutdown(0);
        }

        private void Check_Click_1(object sender, RoutedEventArgs e)
        {

        }

        
    }
}
